import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/category',
    name: 'Category',
    component: () => import('../views/Category.vue')
  },
  {
    path: '/my',
    name: 'My',
    component: () => import('../views/My.vue')
  },
  {
    path: '/bookrack',
    name: 'Bookrack',
    component: () => import("../views/Bookrack")
  },
  {
    path: '/search',
    name: 'Search',
    component: () => import("../components/Search.vue")
  },
  {
    path: '/searchResult/:text',
    name: 'SearchResult',
    props: true,
    component: () => import("../components/SearchResult.vue")
  },
  {
    path: '/bookDetails/:id',
    name: 'BookDetails',
    props: true,
    component: () => import("../components/BookDetails.vue")
  },
  {
    path: "/categoryDetails/:text",
    name: 'CategoryDetails',
    props: true,
    component: () => import("../components/CategoryDetails.vue")
  },
  {
    path: '/bookContent',
    name: 'BookContent',
    component: () => import("../components/BookContent.vue")
  },
  {
    path: '/catalogue',
    name: 'Catalogue',
    component: () => import("../components/Catalogue.vue")
  },
  {
    path: '/bookHistory',
    name: 'BookHistory',
    component: () => import("../components/BookHistory.vue")
  },
  {
    path: '/morebook',
    name: 'MoreBook',
    component: () => import("../components/MoreBook.vue")
  }
]

const router = new VueRouter({
  routes
})

export default router
